package tfts

type modifier struct {
	attrMeta
}

type championMeta struct {
	attrMeta
	name     string
	speed    float64
	initMana int
}

type champion struct {
	*championMeta
	record0
	Health   int // 当前生命值
	maxHp    int // 未计算最大生命值加成的最大生命值
	startHp  int // 开局最大生命值
	attached *Fight
	mana     int
	casting  bool
}

func newChamp() *championMeta {
	attr := attrMeta{
		factor:     100,
		ap:         100,
		as:         100,
		castAmp:    100,
		manaAmp:    100,
		hitMana:    10,
		dmgTaken:   100,
		healthAmp:  100,
		recoverAmp: 100,
		healAmp:    100,
		shieldAmp:  100,
	}
	meta := &championMeta{
		attrMeta: attr,
		speed:    0.75,
	}
	return meta
}

func (h *modifier) valid() bool {
	return true
}
func (c *championMeta) attach(f *Fight) *champion {
	cp := *c
	champ := &champion{
		championMeta: &cp,
		attached:     f,
		mana:         c.initMana,
	}
	f.champion = champ
	// 直接的数值修改使用modifier以避免修改championMeta
	f.attrs = append(f.attrs, &modifier{attrMeta{factor: 100}})
	f.attrs = append(f.attrs, champ)
	champ.attached = f
	return champ
}

func (c *champion) valid() bool {
	return true
}
